IF EXISTS (SELECT * FROM sysobjects WHERE type = 'U' AND name = 'Book')
	BEGIN
		DROP  Table Book
	END
GO

CREATE TABLE Book
(
   Id int IDENTITY PRIMARY KEY CLUSTERED,
   Title varchar(200) NOT NULL,
   Subtitle varchar(200) NULL,
   Isbn varchar(50) NULL,
   NoOfPages int NULL,
   PublicationDate datetime NULL,
   Summary ntext NULL,
   PublisherId int NULL REFERENCES Publisher(Id),
   FormatId int NULL REFERENCES Format(Id),
   ImageId uniqueidentifier NULL,
   ImageExtension varchar(10) NULL,
   LibraryId int NULL REFERENCES Library(Id)
)
GO


